import { IActionData } from '../types/IContext';

export type ActionKey = 'temperature' | 'time';

export interface IColumeItem {
  text: string;
  value: string;
}

interface IModeItem {
  id: number;
  svg: number;
  title: string;
}

// 0-自定义 1-鸡翅 2-鸡腿 3-红薯 4-蛋 5-大虾 6-鱼 7-牛排 8-蛋糕 9-薯条
export const staticModeList: IModeItem[] = [
  {
    id: 0,
    svg: 10,
    title: '自定义'
  },
  {
    id: 1,
    svg: 1,
    title: '鸡翅'
  },
  {
    id: 2,
    svg: 2,
    title: '鸡腿'
  },
  {
    id: 3,
    svg: 3,
    title: '红薯'
  },
  {
    id: 4,
    svg: 4,
    title: '蛋挞'
  },
  {
    id: 5,
    svg: 5,
    title: '大虾'
  },
  {
    id: 6,
    svg: 6,
    title: '鱼'
  },
  {
    id: 7,
    svg: 7,
    title: '牛扒'
  },
  {
    id: 8,
    svg: 8,
    title: '蛋糕'
  },
  {
    id: 9,
    svg: 9,
    title: '薯条'
  }
];

export const staticActionList: IActionData[] = [
  {
    id: 1,
    title: '烹饪温度',
    svg: 'app',
    val: '未设置',
    key: 'temperature'
  },
  {
    id: 2,
    title: '烹饪时间',
    svg: 'time',
    val: '未设置',
    key: 'time'
  }
];

const TEMP_MIN = 80;
const TEMP_MAX = 200;
const TEMP_STEP = 5;

const TIME_MIN = 1;
const TIME_MAX = 60;
const TIME_STEP = 1;

export const tempColumn = () => 
  Array.from(
    { length: (TEMP_MAX - TEMP_MIN) / TEMP_STEP + 1 },
    (_, i) => {
      const value = TEMP_MIN + i * TEMP_STEP;
      return { text: `${value}`, value: `${value}` };
    }
  );

export const timeColumn = () =>
  Array.from(
    { length: (TIME_MAX - TIME_MIN) / TIME_STEP + 1 },
    (_, i) => {
      const value = TIME_MIN + i * TIME_STEP;
      return { text: `${value}`, value: `${value}` };
    }
  );


export const deviceId = 'CMCC-591533-B812DAD727F8';
